<?php
$phone=$_GET['uphone'];//获取手机号
$number=rand(000001,999999);
$name='用户';
$time='60秒';
include './TopSdk.php';
$c = new TopClient;
$c->appkey = '23527661';
$c->secretKey = '26cc3e7d17debd0d48235cb543178ae4';
$req = new AlibabaAliqinFcSmsNumSendRequest;
$req->setSmsType("normal");
$req->setSmsFreeSignName("天际");
$req->setSmsParam("{\"name\":\"{$name}\",\"code\":\"{$number}\",\"time\":\"{$time}\"}");
$req->setRecNum($phone);
$req->setSmsTemplateCode("SMS_25665424");
$resp = $c->execute($req);
$array = json_decode(json_encode($resp),TRUE);
if($array['result']['err_code']=='0'){
	session_start();
	echo $_SESSION['code']=$number;
	
}else{
	echo 0;
}

?>